home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / utils / raysh386 / src / options.c < prev    next >
Encoding:
Text File  |  1992-05-04  |  9.4 KB  |  270 lines

  1. { draw image }
  2.      Delay(PauseTime);
  3. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  4.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  5.   until KeyPressed;
  6.   FreeMem(Saucer, size);
  7.   WaitToGo;
  8. end; { PutImagePlay }
  9.  
  10. procedure PolyPlay;
  11. { Draw random polygons with random fill styles on the screen }
  12. const
  13.   MaxPts = 5;
  14. type
  15.   PolygonType = array[1..MaxPts] of PointType;
  16. var
  17.   Poly : PolygonType;
  18.   I, Color : word;
  19. begin
  20.   MainWindow('FillPoly demonstration');
  21.   StatusLine('Esc aborts or press a key...');
  22.   repeat
  23.     Color := RandColor;
  24.     SetFillStyle(Random(11)+1, Color);
  25.     SetColor(Color);
  26.     for I := 1 to MaxPts do
  27.       with Poly[I] do
  28.       begin
  29.         X := Random(MaxX);
  30.         Y := Random(MaxY);
  31.       end;
  32.     FillPoly(MaxPts, Poly);
  33.   until KeyPressed;
  34.   WaitToGo;
  35. end; { PolyPlay }
  36.  
  37. procedure FillStylePlay;
  38. { Display all of the predefined fill styles available }
  39. var
  40.   Style    : word;
  41.   Width    : word;
  42.   Height   : word;
  43.   X, Y     : word;
  44.   I, J     : word;
  45.   ViewInfo : ViewPortType;
  46.  
  47. procedure DrawBox(X, Y : word);
  48. begin
  49.   SetFillStyle(Style, MaxColor);
  50.   with ViewInfo do
  51.     Bar(X, Y, X+Width, Y+Height);
  52.   Rectangle(X, Y, X+Width, Y+Height);
  53.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  54.   Inc(Style);
  55. end; { DrawBox }
  56.  
  57. begin
  58.   MainWindow('Pre-defined fill styles');
  59.   GetViewSettings(ViewInfo);
  60.   with ViewInfo do
  61.   begin
  62.     Width := 2 * ((x2+1) div 13);
  63.     Height := 2 * ((y2-10) div 10);
  64.   end;
  65.   X := Width div 2;
  66.   Y := Height div 2;
  67.   Style := 0;
  68.   for J := 1 to 3 do
  69.   begin
  70.     for I := 1 to 4 do
  71.     begin
  72.       DrawBox(X, Y);
  73.       Inc(X, (Width div 2) * 3);
  74.     end;
  75.     X := Width div 2;
  76.     Inc(Y, (Height div 2) * 3);
  77.   end;
  78.   SetTextJustify(LeftText, TopText);
  79.   WaitToGo;
  80. end; { FillStylePlay }
  81.  
  82. procedure FillPatternPlay;
  83. { Display some user defined fill patterns }
  84. const
  85.   Patterns : array[0..11] of FillPatternType = (
  86.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  87.             OldColor which has a path of pixels of OldColor or NewColor
  88.             with sides touching back to the seed point, (XSeed, YSeed).
  89.             Therefore, only pixels of OldColor are modified and no other
  90.             information is changed.
  91.  
  92.             SEE ALSO
  93.  
  94.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  95.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  96.             SETVIEW
  97.  
  98.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  99.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  100.             IF WHICHVGA = 0 THEN STOP
  101.             DUMMY=RES640
  102.             SETVIEW 100, 100, 539, 379
  103.             FILLVIEW 10
  104.             WHILE INKEY$ = ""
  105.             WEND
  106.             VIDEOMODESET VMODE
  107.             END
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                                                          63
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.           FONTGETINFO
  132.  
  133.             PROTOTYPE
  134.  
  135.             SUB FONTGETINFO (Width%, Height%)
  136.  
  137.             INPUT
  138.  
  139.             no input parameters
  140.     WEND
  141.             MOUSEEXIT
  142.             VIDEOMODESET VMODE
  143.             END
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.                                                                          86
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.           MOUSECURSORDEFAULT
  192.  
  193.             PROTOTYPE
  194.  
  195.             SUB MOUSECURSORDEFAULT ()
  196.  
  197.             INPUT
  198.  
  199.             no input parameters
  200.  
  201.             OUTPUT
  202.  
  203.             no value returned
  204.  
  205.             USAGE
  206.  
  207.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  208.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  209. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  210. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  211. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  212. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  213. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  214. $╤
  215. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  216. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  217. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  218. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  219. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  220. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  221. ░£▒
  222. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  223. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  224.       end;
  225.     end;
  226.   end;
  227.   WaitToGo;
  228. end; { UserLineStylePlay }
  229.  
  230.  
  231. procedure SayGoodbye;
  232. { Say goodbye and then exit the program }
  233. var
  234.   ViewInfo : ViewPortType;
  235. begin
  236.   MainWindow('');
  237.   GetViewSettings(ViewInfo);
  238.   SetTextStyle(TriplexFont, HorizDir, 4);
  239.   SetTextJustify(CenterText, CenterText);
  240.   with ViewInfo do
  241.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  242.   StatusLine('Press any key to quit...');
  243.   repeat until KeyPressed;
  244. end; { SayGoodbye }
  245.  
  246.  
  247. PROCEDURE SelectMode;
  248. VAR
  249.     choice1,choice2     : CHAR;
  250.    xsize,ysize            : WORD;
  251. BEGIN
  252.     (* Let's select a mode *)
  253.     ClrScr;
  254.     WriteLn('VESADEMO:');
  255.     WriteLn('1. 256 colors');
  256.     WriteLn('2. 32768 colors');
  257.     WriteLn('3. 65536 colors');
  258.     WriteLn('4. 16777216 colors');
  259.     WriteLn('Q uit');
  260.     WriteLn;
  261.     Write('Your choice: ');
  262.     REPEAT
  263.         ReadLn(choice1);
  264.       IF choice1 <> '1' THEN BEGIN
  265.           WriteLn('Sorry !');
  266.          WriteLn('This demo wasn''t written for more as 256 colors !');
  267.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  268.          WriteLn('Switching to 256 colors.');
  269.          choice1 := '1';
  270.       END;
  271.     UNTIL choice1 IN ['1'..'4','q'];
  272.     IF choice1 = 'q' THEN Halt;
  273.  
  274.     WriteLn;
  275.     WriteLn;
  276.     WriteLn('a. 320x200');
  277.     WriteLn('b. 640x480');
  278.     WriteLn('c. 800x600');
  279.     WriteLn('d. 1024x768');
  280.     WriteLn('e. 1280x